<?php


namespace app\nav\controller;



use library\Controller;
use think\facade\Request;

class Setting extends Controller
{

    protected $table = 'SystemConfig';

    /**
     * @auth true
     * @menu
     * @throws \think\Exception
     * @throws \think\exception\PDOException
     */
    public function index()
    {
        $this->applyCsrfToken();
        if (Request::isGet()) {
            $this->title = '导航参数设置';
            $this->fetch();
        } else {
            foreach (Request::post() as $key => $value) {
                sysconf($key, $value);
            }
            $this->success('系统参数配置成功！');
        }
    }
}